#!/bin/sh
# This regression test is a part of SIPp.
# With -t un and no -i, the local address comes from a temporary UDP
# socket; its port must not be reused for every call's socket, or the
# second call fails with "Unable to bind UDP socket, errno = 98".
. "`dirname "$0"`/../functions"; init

sippbg -sn uas -i 127.0.0.1 -p 25210 -m 3
sippfg -sn uac -t un -m 3 -l 3 -r 100 -d 500 -p 25211 127.0.0.1:25210 \
    -timeout 8 -timeout_error >/dev/null 2>&1
status=$?

if test $status -ne 0; then
    fail "UAC failed with $status"
else
    ok
fi
